<%-- 
  - Author: Jordi Vilaplana Mayoral <jvilaplana@alumnes.udl.cat>
  - Date: 05/04/2011
  - 
  - LocationManager
  - Copyright (C) 2011 Jordi Vilaplana Mayoral
  -
  - This program is free software: you can redistribute it and/or modify
  - it under the terms of the GNU General Public License as published by
  - the Free Software Foundation, either version 3 of the License, or
  - (at your option) any later version.
  -
  - This program is distributed in the hope that it will be useful,
  - but WITHOUT ANY WARRANTY; without even the implied warranty of
  - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  - GNU General Public License for more details.
  -
  - You should have received a copy of the GNU General Public License
  - along with this program.  If not, see <http://www.gnu.org/licenses/>.
  - 
  - @(#)
  - Description: This program allows users to book rooms and schedule activities
  --%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE HTML>

<html>
  <head>
    <%@ include file="WEB-INF/jspf/head.jspf" %>
    <script>
      function setLogin(user, pass) {
        document.getElementById('userName').value = user;
        document.getElementById('password').value = pass;
      }
    </script>
  </head>

  <body>

    <h1>Location Manager - Entrada</h1>

    <div class="note">
      <p><b>Usuaris de mostra:</b></p>
      <p class="noteLogin" onclick="setLogin('Jordi', 'mandarina')"><img alt="Entrar" src="img/key.png" /> Administrador: Jordi / mandarina</p>
      <p class="noteLogin" onclick="setLogin('Andreu', 'patata')"><img alt="Entrar" src="img/key.png" /> Gestor: Andreu / patata</p>
      <p class="noteLogin" onclick="setLogin('Carme', 'poma')"><img alt="Entrar" src="img/key.png" /> Estudiant: Carme / poma</p>

    </div>

    <div class="login">

      <form action="Login" method="get">
        <label for="userName" class="login">Nom d'usuari:</label>
        <input autofocus id="userName" type="text" maxlength="70" name="userName" />
        <br />
        <label for="password" class="login">Contrasenya:</label>
        <input id="password" type="password" maxlength="70" name="password" />
        <br />
        <br />
        <div class="buttons">
          <button class="regular" type="submit" name="login">
            <img src="img/key.png" /> Entrar
          </button>
        </div>
      </form>
      <br />

      <c:choose>
        <c:when test="${requestScope.error != null}">
          <p class="error">
            <b>ERROR:</b> No s'ha pogut validar l'usuari.
            <br />Nom d'usuari o contrasenya incorrectes.
            <br />No s'ha pogut connectar amb la base de dades.
          </p>
        </c:when>
      </c:choose>

    </div>

  </body>

</html>
